package cn.kgc.tcst004.test;

import cn.kgc.tcst004.pojo.Blog;
import cn.kgc.tcst004.service.BlogService;
import com.github.pagehelper.PageHelper;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class test {
    @Test
    public void test01(){
        PageHelper.startPage(1,1);
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BlogService blogService = (BlogService) context.getBean("BlogService");
        List<Blog> blogs = blogService.getBlogs();
        for (Blog blog : blogs) {
            System.out.println(blog);
        }
    }
}
